
//
//  ThemeChoiceTableViewCell.m
//  weibo-01
//
//  Created by HZApple on 16/5/10.
//  Copyright © 2016年 hdu. All rights reserved.
//

#import "ThemeChoiceTableViewCell.h"


@implementation ThemeChoiceTableViewCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self _loadView];
        self.backgroundColor = [UIColor clearColor];
        self.contentView.backgroundColor = [UIColor clearColor];
    }
    return self;
}

- (void)_loadView {
    _label = [[ThemeLabel alloc] initWithFrame:CGRectMake(80, 10, 150, 30)];
    [self addSubview:_label];
    _themeImageView = [[ThemeImageView alloc] initWithFrame:CGRectMake(20, 4, 42, 42)];
    [self addSubview:_themeImageView];
}

- (void)setModel:(ThemeChoiceModel *)model {
    _model = model;
    _label.text = _model.themeName;
    
    NSString *imagePath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:_model.themePath];

    imagePath = [imagePath stringByAppendingPathComponent:_model.imageName];
    
    
    [_themeImageView setImage:[UIImage imageWithContentsOfFile:imagePath]];
    //[_themeImageView setImageName:_model.imageName];
    [_label setColorName:_model.themeColorName];
    
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
